#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
void solve()
{
    int level = 0;
    int a, b, c;
    cin >> a >> b >> c;
    switch (a)
    {
    case 150:
        level++;
        break;
    case 200:
        level += 2;
        break;
    default:
        break;
    }
    switch (b)
    {
    case 34:
    case 36:
    case 38:
    case 40:
        level++;
        break;
    case 45:
        level += 2;
        break;
    default:
        break;
    }
    switch (c)
    {
    case 34:
    case 36:
    case 38:
    case 40:
        level++;
        break;
    case 45:
        level += 2;
        break;
    default:
        break;
    }
    cout << level << endl;
}
int main()
{
    ll t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}
